public class LeapYears {
    public static void main(String[] args) {
        int startYear = 1988;
        int endYear = 2019;

        // 打印范围内的所有闰年
        System.out.println("Leap years from " + startYear + " to " + endYear + ":");
        for (int year = startYear; year <= endYear; year++) {
            if (isLeapYear(year)) {
                System.out.println(year);
            }
        }
    }

    // 判断是否为闰年的方法
    public static boolean isLeapYear(int year) {
        // 能被4整除且不能被100整除，或者能被400整除
        return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
    }
}
